package com.sc.nft.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.PayOrderPageDTO;
import com.sc.nft.entity.PayOrder;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.vo.GetPaySignVO;
import com.sc.nft.enums.PayChannelEnum;
import com.sc.nft.enums.PayMethodEnum;
import com.sc.nft.enums.PayStatusEnum;
import com.sc.nft.enums.PayTypeEnum;
import com.sc.nft.exception.GlobalException;

import java.util.Date;
import java.util.List;

public interface PayOrderService {


    /**
     * 获取支付参数
     *
     * @param orderId
     * @param userInfo
     */
    GetPaySignVO getPay(PayMethodEnum payMethod, Long orderId, Long bankCardId, UserInfo userInfo, String IP, String mac, Boolean webPay, Integer jumpType);

    GetPaySignVO getPayRough(PayMethodEnum payMethod, Long orderId, Long bankCardId, UserInfo userInfo, String IP, String mac, Boolean webPay, Integer jumpType);

    /**
     * 名片支付
     *
     * @param payMethod
     * @param orderId
     * @param bankCardId
     * @param bankCardId
     * @param userInfo
     * @param IP
     * @param mac
     * @param webPay
     * @param jumpType
     * @return
     */
    GetPaySignVO getPayBusinessCard(PayMethodEnum payMethod, Long orderId, Long bankCardId, UserInfo userInfo, String IP, String mac, Boolean webPay, Integer jumpType);

    /**
     * 获取支付参数（二级）
     *
     * @param payMethod
     * @param orderIds
     * @param userInfo
     * @param IP
     * @param mac
     * @param webPay
     * @return
     */
    GetPaySignVO getPaySecond(PayMethodEnum payMethod, List<Long> orderIds, Long bankCardId, UserInfo userInfo, String IP, String mac, Boolean webPay, String password, String randomKey);

    GetPaySignVO getPayProps(PayMethodEnum payMethod, List<Long> orderIds, Long bankCardId, UserInfo userInfo, String IP, String mac, Boolean webPay, String password, String randomKey);


    /**
     * 连连支付短信验证
     *
     * @param userInfo
     * @param token
     * @param smsCode
     */
    void llPayVerify(UserInfo userInfo, Long id, String token, String smsCode);


    /**
     * 绑卡支付原石订单发送短信
     * @param bankCardId
     * @param orderId
     * @param userInfo
     * @param IP
     * @return
     */


    /**
     * 汇付钱包开户
     *
     * @param userInfo
     */
    String HfOpenAccount(UserInfo userInfo, Boolean isWeb);

    /**
     * 汇付钱包管理地址
     *
     * @param userInfo
     * @return
     */
    String HfWallet(UserInfo userInfo, Boolean isWeb);

    /**
     * 查询汇付余额
     *
     * @param userInfo
     * @return
     */
    JSONObject HfBalance(UserInfo userInfo);

    void orderPaySuccess(PayOrder payOrder, String payTime, String result) throws GlobalException;

    void hfOpenNotify(String userId, String userCustId, String acctId) throws GlobalException;


    Boolean getPayOrderStatus(String orderNo);


    /**
     * 支付验证
     *
     * @param userInfo
     * @param dealPassWord
     * @param verifyCode
     * @param token
     * @throws GlobalException
     */
    void verifyPay(UserInfo userInfo, Long id, String dealPassWord, String verifyCode, String token);

    /**
     * 支付轨迹表分页
     *
     * @param orderNo      订单编号
     * @param tradeNo      交易订单号
     * @param userTel      手机号
     * @param payType      支付类方式
     * @param channel      支付渠道
     * @param orderType    订单类型
     * @param bankCardNo   银行卡号
     * @param status       状态
     * @param startPayTime 开始支付时间
     * @param endPayTime   结束支付时间
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<PayOrderPageDTO> payOrderPageFromAdmin(String orderNo, String tradeNo, String userTel, PayMethodEnum payType,
                                                PayChannelEnum channel, PayTypeEnum orderType, String bankCardNo,
                                                PayStatusEnum status, Date startPayTime,
                                                Date endPayTime, int pageNo, int pageSize);

    GetPaySignVO getPayWantBuy(PayMethodEnum paymentMethod, Long orderId, Long bankCardId, UserInfo user, String clientIP, String mac, Boolean webPay, Integer jumpType, String password, String randomKey);

    GetPaySignVO getPayCollective(PayMethodEnum paymentMethod, List<Long> orderIds, Long bankCardId, UserInfo user, String clientIP, String mac, Boolean webPay, Integer jumpType, String password, String randomKey);


    /**
     * 苹果支付
     * @param orderId
     * @param receiptData
     * @param IP
     */
    void applePay(Long orderId, String receiptData,String isSandBox, String IP) throws GlobalException;
}
